<template>
    <div class="playSwipe">
        <van-swipe class="my-swipe" :loop="false" :width="140" :height="180" :show-indicators="false">
            <van-swipe-item v-for="(it,i) in fmList" :key="it.id" @click="toFmDetail(i)">
                <img :src="it.img" alt="">
                <div class="subTitle">{{ it.title }}</div>
            </van-swipe-item>
        </van-swipe>
    </div>
</template>

<script setup lang="ts">
import {defineProps, } from 'vue'
// import ajax from '../apis/Ajax';
import { useRouter } from 'vue-router';
import useCommonStore  from '../store/common';

// const fmDetail:any = ref('')
const router = useRouter()
const store = useCommonStore()

defineProps({
    fmList:{
        type: Array,
        default:[]
    }
})
//传热门的索引，点击时候展示详情页面
function toFmDetail(i:any){
    // console.log(i)
    store.rid = i
    store.isShow = true
}

</script>

<style lang="less">
.playSwipe {
    width: 100%;
    .my-swipe .van-swipe-item {
        position:relative;
        text-align: left;
        background-color: #fff;
        margin-right: 20px;
        img{
            width: 100%;
        }
        .subTitle {
            position: absolute;
            bottom: 0;
            left: 0;
        }
  }
}
</style>